<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>

export default {
  name: 'App',
  watch:{
    $route(newVal,oldVal){
      let timer = setTimeout(() => {
        clearTimeout(timer)
        if(newVal.path === newVal.path){  
          if(newVal.path !== '/login'){
            this.$message.error('身份已过期，请重新登录')
          }
          sessionStorage.removeItem('userName')  
        }
      },5000*60)
    }
  }
}
</script>

<style>
body{
  background: #304156;
}
*{
  padding: 0;
  margin: 0;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  background: #304156;
}
</style>
